package starter.kit.rx.app.feature.main;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.hdodenhof.circleimageview.CircleImageView;
import starter.kit.rx.app.R;
import starter.kit.rx.app.model.bean.home.ThemeColor;
import support.ui.adapters.EasyViewHolder;

/**
 * ============================================================
 * 版权： Blue mobile 版权所有（c）2016
 * <p>
 * 作者：Loofer
 * 版本：1.0
 * 创建日期 ：2016/10/31 15:19.
 * 描述：
 * <p>
 * 注:如果您修改了本类请填写以下内容作为记录，如非本人操作劳烦通知，谢谢！！！
 * Modified Date Modify Content:
 * <p>
 * ==========================================================
 */
public class ThemeColorViewHolder extends EasyViewHolder<ThemeColor> {


    @BindView(R.id.them_color)
    CircleImageView mThemColor;
    @BindView(R.id.choose)
    ImageView mChoose;
    private Context mContext;

    public ThemeColorViewHolder(Context context, ViewGroup parent) {
        super(context, parent, R.layout.item_theme_color);
        ButterKnife.bind(this, itemView);
        this.mContext = context;
    }

    @Override
    public void bindTo(int position, ThemeColor themeColor) {
        mThemColor.setImageResource(themeColor.getColor());
        if (themeColor.isChosen()) {
            mChoose.setVisibility(View.VISIBLE);
        } else {
            mChoose.setVisibility(View.GONE);
        }
    }


}
